package com.video.system.service.impl;

import java.util.List;
import com.video.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.video.system.mapper.VideoTeacherTitleMapper;
import com.video.system.domain.VideoTeacherTitle;
import com.video.system.service.IVideoTeacherTitleService;
import com.video.common.core.text.Convert;

/**
 * 职称Service业务层处理
 * 
 * @author lyh
 * @date 2021-07-20
 */
@Service
public class VideoTeacherTitleServiceImpl implements IVideoTeacherTitleService 
{
    @Autowired
    private VideoTeacherTitleMapper videoTeacherTitleMapper;

    /**
     * 查询职称编码和名称
     * @return
     */
    @Override
    public List<VideoTeacherTitle> selectCodeAndNameAll() {
        return videoTeacherTitleMapper.selectCodeAndNameAll();
    }

    /**
     * 查询职称
     * 
     * @param titleId 职称ID
     * @return 职称
     */
    @Override
    public VideoTeacherTitle selectVideoTeacherTitleById(Integer titleId)
    {
        return videoTeacherTitleMapper.selectVideoTeacherTitleById(titleId);
    }

    /**
     * 查询职称列表
     * 
     * @param videoTeacherTitle 职称
     * @return 职称
     */
    @Override
    public List<VideoTeacherTitle> selectVideoTeacherTitleList(VideoTeacherTitle videoTeacherTitle)
    {
        return videoTeacherTitleMapper.selectVideoTeacherTitleList(videoTeacherTitle);
    }

    /**
     * 新增职称
     * 
     * @param videoTeacherTitle 职称
     * @return 结果
     */
    @Override
    public int insertVideoTeacherTitle(VideoTeacherTitle videoTeacherTitle)
    {
        videoTeacherTitle.setCreateTime(DateUtils.getNowDate());
        return videoTeacherTitleMapper.insertVideoTeacherTitle(videoTeacherTitle);
    }

    /**
     * 修改职称
     * 
     * @param videoTeacherTitle 职称
     * @return 结果
     */
    @Override
    public int updateVideoTeacherTitle(VideoTeacherTitle videoTeacherTitle)
    {
        videoTeacherTitle.setUpdateTime(DateUtils.getNowDate());
        return videoTeacherTitleMapper.updateVideoTeacherTitle(videoTeacherTitle);
    }

    /**
     * 删除职称对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteVideoTeacherTitleByIds(String ids)
    {
        return videoTeacherTitleMapper.deleteVideoTeacherTitleByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除职称信息
     * 
     * @param titleId 职称ID
     * @return 结果
     */
    @Override
    public int deleteVideoTeacherTitleById(Integer titleId)
    {
        return videoTeacherTitleMapper.deleteVideoTeacherTitleById(titleId);
    }
}
